<?php

/**
 * TbsClienteTamBd form base class.
 *
 * @method TbsClienteTamBd getObject() Returns the current form's model object
 *
 * @package    AltargetEcommerce
 * @subpackage form
 * @author     Carlo Lopez
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseTbsClienteTamBdForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'cltb_codigo'    => new sfWidgetFormInputHidden(),
      'cltb_fechaini'  => new sfWidgetFormDate(),
      'cltb_fechafin'  => new sfWidgetFormDate(),
      'cltb_fechagen'  => new sfWidgetFormDate(),
      'cltb_maxenvios' => new sfWidgetFormInputText(),
      'cltb_status'    => new sfWidgetFormInputText(),
      'cltb_origen'    => new sfWidgetFormInputText(),
      'cltb_codcli'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('fk_cltb_codcli'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'cltb_codigo'    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('cltb_codigo')), 'empty_value' => $this->getObject()->get('cltb_codigo'), 'required' => false)),
      'cltb_fechaini'  => new sfValidatorDate(),
      'cltb_fechafin'  => new sfValidatorDate(),
      'cltb_fechagen'  => new sfValidatorDate(),
      'cltb_maxenvios' => new sfValidatorInteger(),
      'cltb_status'    => new sfValidatorString(array('max_length' => 1)),
      'cltb_origen'    => new sfValidatorString(array('max_length' => 1)),
      'cltb_codcli'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('fk_cltb_codcli'))),
    ));

    $this->widgetSchema->setNameFormat('tbs_cliente_tam_bd[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'TbsClienteTamBd';
  }

}
